/***************************************************************************//**
 * @file FDM/FDM_DataOut.h
 * @author  Marek M. Cel <marekcel@mscsim.org>
 *
 * @section LICENSE
 *
 * Copyright (C) 2013 Marek M. Cel
 *
 * This file is part of MScSim. You can redistribute and modify it under
 * the terms of GNU General Public License as published by the Free Software
 * Foundation; either version 3 of the License, or (at your option) any later
 * version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
 * for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.
 * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Further information about the GNU General Public License can also be found
 * on the world wide web at http://www.gnu.org.
 ******************************************************************************/
#ifndef FDM_DATA_OUT_H
#define FDM_DATA_OUT_H

////////////////////////////////////////////////////////////////////////////////

#include <mscsim_defs.h>

////////////////////////////////////////////////////////////////////////////////

/** FDM data output struct. */
struct FDM_DataOut
{
    /** */
    struct FlightData
    {
        double latitude;            ///< [rad] geodetic latitude
        double longitude;           ///< [rad] geodetic longitude

        double altitude_asl;        ///< [m] altitude above sea level
        double altitude_agl;        ///< [m] altitude above ground level

        double rollAngle;           ///< [rad] roll angle
        double pitchAngle;          ///< [rad] pitch angle
        double heading;             ///< [rad] true heading

        double angleOfAttack;       ///< [rad] angle of attack
        double sideslipAngle;       ///< [rad] angle of sideslip

        double course;              ///< [rad] course
        double pathAngle;           ///< [rad] path angle

        double slipSkidAngle;       ///< [rad] slip/skid angle

        double airspeed;            ///< [m/s] airspeed
        double machNumber;          ///< [-] Mach number
        double climbRate;           ///< [m/s] climb rate

        double turnRate;            ///< [rad/s] turn rate (heading change rate)

        double bas_u;               ///< [m/s] velcoity U component expressed in BAS
        double bas_v;               ///< [m/s] velcoity V component expressed in BAS
        double bas_w;               ///< [m/s] velcoity W component expressed in BAS

        double bas_p;               ///< [rad/s] angular velcoity P component expressed in BAS
        double bas_q;               ///< [rad/s] angular velcoity Q component expressed in BAS
        double bas_r;               ///< [rad/s] angular velcoity R component expressed in BAS

        double bas_u_dot;           ///< [m/s^2] velcoity U component derivative (acceleration) expressed in BAS
        double bas_v_dot;           ///< [m/s^2] velcoity V component derivative (acceleration) expressed in BAS
        double bas_w_dot;           ///< [m/s^2] velcoity W component derivative (acceleration) expressed in BAS

        double bas_p_dot;           ///< [rad/s^2] angular velcoity P component derivative (acceleration) expressed in BAS
        double bas_q_dot;           ///< [rad/s^2] angular velcoity Q component derivative (acceleration) expressed in BAS
        double bas_r_dot;           ///< [rad/s^2] angular velcoity R component derivative (acceleration) expressed in BAS

        double wgs_x;               ///< [m] postion X component expressed in WGS
        double wgs_y;               ///< [m] postion Y component expressed in WGS
        double wgs_z;               ///< [m] postion Z component expressed in WGS

        double wgs_phi;             ///< [rad] angle of rotation from WGS to BAS about X-axis using z-y-x convention (Bryant angles/roll-pitch-heading)
        double wgs_tht;             ///< [rad] angle of rotation from WGS to BAS about Y-axis using z-y-x convention (Bryant angles/roll-pitch-heading)
        double wgs_psi;             ///< [rad] angle of rotation from WGS to BAS about Z-axis using z-y-x convention (Bryant angles/roll-pitch-heading)

        double wgs_u;               ///< [m/s] velcoity U component expressed in WGS
        double wgs_v;               ///< [m/s] velcoity V component expressed in WGS
        double wgs_w;               ///< [m/s] velcoity W component expressed in WGS

        double wgs_p;               ///< [rad/s] angular velcoity P component expressed in WGS
        double wgs_q;               ///< [rad/s] angular velcoity Q component expressed in WGS
        double wgs_r;               ///< [rad/s] angular velcoity R component expressed in WGS

        double wgs_u_dot;           ///< [m/s^2] velcoity U component derivative (acceleration) expressed in WGS
        double wgs_v_dot;           ///< [m/s^2] velcoity V component derivative (acceleration) expressed in WGS
        double wgs_w_dot;           ///< [m/s^2] velcoity W component derivative (acceleration) expressed in WGS

        double wgs_p_dot;           ///< [rad/s^2] angular velcoity P component derivative (acceleration) expressed in WGS
        double wgs_q_dot;           ///< [rad/s^2] angular velcoity Q component derivative (acceleration) expressed in WGS
        double wgs_r_dot;           ///< [rad/s^2] angular velcoity R component derivative (acceleration) expressed in WGS

        double Gx;                  ///< [-] X component of G-Force vector expressed in BAS
        double Gy;                  ///< [-] Y component of G-Force vector expressed in BAS
        double Gz;                  ///< [-] Z component of G-Force vector expressed in BAS
    };

    FlightData  flightData;     ///< flight data

    MScSimState outState;       ///< output state @see MScSimState
};

////////////////////////////////////////////////////////////////////////////////

#endif // FDM_DATA_OUT_H
